<template>
  <div class="nav-bar">
    <van-nav-bar
      :title="title"
      left-text="返回"
      left-arrow
      @click-left="back"
    />
  </div>
</template>

<script>
export default {
  name: 'Navbar',
  computed: {
    title () {
      return this.$route.meta.title || '商城'
    }
  },
  methods: {
    back () {
      // 编程式的导航，实现后退功能
      this.$router.back()
    }
  }
}
</script>

<style lang="less" scoped>

</style>
